import axios from "../api"; // 导入接口配置
/**
 * 登录
 * @param params
 * @returns
 */
export const UserLogin = async (params: any) => {
  return await axios.post("/api/UserInfo/LogInSystem", params);
};
/**
 * 创建用户
 * @param params
 * @returns
 */
export const InsertUserInfo = async (params: any) => {
  return await axios.post("/api/UserInfo/InsertUserInfo", params);
};

/**
 * 修改当前用户头像
 * @param params
 * @returns
 */
export const UpdateUserAvatarInfo = async (params: any) => {
  return await axios.post("/api/UserInfo/UpdateUserAvatarInfo", params);
};

/**
 * 获取当前登录用户
 * @param params
 * @returns
 */
export const GetSingleUserInfo = async () => {
  return await axios.post("/api/UserInfo/GetSingleUserInfo", {});
};

/**
 * 获取用户信息
 * @param params
 * @returns
 */
export const GetAllUserInfo = async (params: any) => {
  return await axios.post("/api/UserInfo/GetAllUserInfo", params);
};

/**
 * 修改用户信息
 * @param params
 * @returns
 */
export const UpdateUserInfo = async (params: any) => {
  return await axios.post("/api/UserInfo/UpdateUserInfo", params);
};

/**
 * 删除用户信息
 * @param params
 * @returns
 */
export const DeleteUserInfo = async (params: any) => {
  return await axios.post("/api/UserInfo/DeleteUserInfo", params);
};

/**
 * 权限列表查询
 * @param params
 * @returns
 */
export const GetPermissionsList = async (params: any) => {
  return await axios.post("/api/UserInfo/GetPermissionsList", params);
};

/**
 * 获取用户历史登录信息
 * @param params
 * @returns
 */
export const GetUserLoginInfo = async (params: any) => {
  return await axios.post("/api/UserInfo/GetUserLoginInfo", params);
};

/**
 * 更新用户权限
 * @param params
 * @returns
 */
export const InsertOrUpdateUserPermissions = async (params: any) => {
  return await axios.post(
    "/api/UserInfo/InsertOrUpdateUserPermissions",
    params
  );
};
/**
 * @description: 查询用户权限
 * @param {any} params
 * @return {*}
 * @author: cool panda
 */
export const GetUserPermissions = async (params: any) => {
  return await axios.post("/api/UserInfo/GetUserPermissions", params);
};
